< previous page page_733 next page >

Page 733
In the sample, note that only one asynchronous download is happening. If you initiate multiple downloads, you can use the PropertyName property to determine which object is passed to the AsyncReadComplete event. In this case, the value of that property is MyPicture.
In addition to starting an asynchronous read and detecting when it completes, Visual Basic 6 now allows you to monitor its progress through the AsyncReadProgress event. Several properties are passed to this event, allowing you to display the download progress to the user. For example, you may want to display a status bar with the number of bytes downloaded or inform the user as connections are made and downloads are started.
Using the Hyperlink Object in Your Document
One object of extreme importance in ActiveX documents is the Hyperlink object. This object is accessed through the HyperLink property of the UserDocument object. It has no properties and only three methods. However, the Hyperlink object is what enables an ActiveX document to call another ActiveX document or to navigate to a Web site. The three methods of the Hyperlink object are the following:
NavigateTo. This method causes the container that holds the ActiveX document to jump to a file or URL specified in the method. You use this method to move from one ActiveX document to another.
GoBack. This method performs a hyperlink jump to the previous document in the history list of a container. If the container does not support hyperlinking or no items appear in the history list, an error occurs.
GoForward. This method is the counterpart of the GoBack method. GoForward causes the container to move to the next document in the history list. If no more documents are available, an error occurs.
note.gif A container such as Internet Explorer, which supports hyperlinking, executes on its own the jump specified in a NavigateTo method. A container such as Office 97 Binder, which does not support hyperlinking, starts a hyperlink-capable program to process the jump. square.gif

The following lines of code show example uses of the Navigate method:
UserDocument.Hyperlink.NavigateTo "MyDoc.VBD"
UserDocument.Hyperlink.NavigateTo "http://www.mysite.com"
The first line of code loads another ActiveX document in the same directory, while the second example directs the container to an Internet site.
Using the ActiveX Document Migration Wizard
So far, you have learned how to create an ActiveX document from scratch. But, if you are like me, you have a lot of time and effort invested in creating standard Visual Basic applications. Can you capitalize on the work you have already done, short of using cut and paste to bring in pieces of a program?

 
< previous page page_733 next page >